package com.onehash.onebilling.gui;

import java.awt.*;

import javax.swing.*;
import java.awt.Rectangle;
import javax.swing.BorderFactory;


import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.BorderLayout;
import java.awt.Color;


import com.onehash.onebilling.entity.*;
import com.onehash.onebilling.entity.User.*;

import com.onehash.onebilling.entity.*;
import com.onehash.onebilling.gui.panel.*;



public class OneBillingNewTransactionDlg extends JDialog {
    JPanel JPnewTransaction = new JPanel();
    JTabbedPane JTPnewTransaction = new JTabbedPane();
    JPanel JPinventoryControl = new JPanel();
    JPanel JPmemAdmin = new JPanel();
    JPanel JPuserAdmin = new JPanel();
    JPanel JPbasicReport = new JPanel();
    JPanel JPrewardMgt = new JPanel();
    JLabel imageLabel = new JLabel();
    JButton Bclose = new JButton();
    JButton BaddDisc = new JButton();
    JButton BremoveDisc = new JButton();
    JButton BeditDisc = new JButton();
    JButton BaddMember = new JButton();
    JButton BcancelMember = new JButton();
    JButton BeditMember = new JButton();
    JButton BunbanMember = new JButton();
    JButton BcheckoutDisc = new JButton();
    JButton BcheckinDisc = new JButton();
    JButton BreportLostDisc = new JButton();
    JButton BpayFees = new JButton();
    JButton BexpenseReport = new JButton();
    JButton BrevReport = new JButton();
    JButton BdueItemsReport = new JButton();
    JButton BcheckCollect = new JButton();
    JButton BmemberPolicy = new JButton();
    JButton BrentalPolicy = new JButton();
    JButton BbanMember = new JButton();
    JButton BdiscTypeAdmin = new JButton();
    
    //newly added

    JButton BaddUsers = new JButton();
    JButton BeditRemoveUsers = new JButton();
    JButton BviewUsers = new JButton();
    

    /* Controller object */
    User loginUser;
    
    public OneBillingNewTransactionDlg(Frame owner, String title, boolean modal, User loginUser) {
        super(owner, title, modal);
        try {
            setDefaultCloseOperation(DISPOSE_ON_CLOSE);
            this.loginUser = loginUser;
            jbInit();
            pack();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    public OneBillingNewTransactionDlg() {
        this(new Frame(), "", false, null);
    }
    
    
    private void jbInit() throws Exception {
        JPnewTransaction.setLayout(null);
        this.setResizable(false);
        JTPnewTransaction.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        JTPnewTransaction.setBorder(BorderFactory.createRaisedBevelBorder());
        JTPnewTransaction.setMinimumSize(new Dimension(489, 300));
        JTPnewTransaction.setPreferredSize(new Dimension(489, 300));
        JTPnewTransaction.setBounds(new Rectangle(22, 85, 623, 306));
        JPinventoryControl.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        JPinventoryControl.setMinimumSize(new Dimension(489, 300));
        JPinventoryControl.setPreferredSize(new Dimension(489, 300));
        JPnewTransaction.setMinimumSize(new Dimension(673, 450));
        JPnewTransaction.setPreferredSize(new Dimension(673, 450));
        Bclose.setBounds(new Rectangle(555, 405, 90, 32));
        Bclose.setMnemonic('C');
        Bclose.setText("Close");
        Bclose.addActionListener(new
        		OneBillingNewTransactionDlg_Bclose_actionAdapter(this));
        BaddDisc.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BaddDisc.setBorderPainted(false);
        BaddDisc.setContentAreaFilled(false);
        BaddDisc.setText("Add Disc Record");
        BaddDisc.addActionListener(new
        		OneBillingNewTransactionDlg_BaddDisc_actionAdapter(this));
        BaddDisc.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/addDisc.png")));
        BremoveDisc.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BremoveDisc.setBorderPainted(false);
        BremoveDisc.setContentAreaFilled(false);
        BremoveDisc.setText("Remove Disc Record");
        BremoveDisc.addActionListener(new
        		OneBillingNewTransactionDlg_BremoveDisc_actionAdapter(this));
        BremoveDisc.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/removeDisc.png")));
        BeditDisc.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BeditDisc.setBorderPainted(false);
        BeditDisc.setContentAreaFilled(false);
        BeditDisc.setText("Edit Disc Record");
        BeditDisc.addActionListener(new
        		OneBillingNewTransactionDlg_BeditDisc_actionAdapter(this));
        BeditDisc.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/editDisc.png")));
        BaddMember.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BaddMember.setBorderPainted(false);
        BaddMember.setContentAreaFilled(false);
        BaddMember.setText("Add New Member");
        BaddMember.addActionListener(new
        		OneBillingNewTransactionDlg_BaddMember_actionAdapter(this));
        BaddMember.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/addMember.png")));
        BcancelMember.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BcancelMember.setBorderPainted(false);
        BcancelMember.setContentAreaFilled(false);
        BcancelMember.setText("Cancel Membership");
        BcancelMember.addActionListener(new
        		OneBillingNewTransactionDlg_BcancelMember_actionAdapter(this));
        BcancelMember.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/cancelMember.png")));
        BeditMember.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BeditMember.setBorderPainted(false);
        BeditMember.setContentAreaFilled(false);
        BeditMember.setText("Edit/Upgrade Member");
        BeditMember.addActionListener(new
        		OneBillingNewTransactionDlg_BeditMember_actionAdapter(this));
        BeditMember.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/editMember.png")));
        BunbanMember.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BunbanMember.setBorderPainted(false);
        BunbanMember.setContentAreaFilled(false);
        BunbanMember.setText("Unban Member");
        BunbanMember.addActionListener(new
        		OneBillingNewTransactionDlg_BunbanMember_actionAdapter(this));
        BunbanMember.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/unbanMember.png")));
        imageLabel.setBounds(0, 0, 673, 450);
        imageLabel.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/BgNewTransaction.jpg")));
        
        
        BcheckoutDisc.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BcheckoutDisc.setBorderPainted(false);
        BcheckoutDisc.setContentAreaFilled(false);
        BcheckoutDisc.setText("Check Out Disc");
        BcheckoutDisc.addActionListener(new
        		OneBillingNewTransactionDlg_BcheckoutDisc_actionAdapter(this));
        BcheckoutDisc.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/checkout.png")));
        BcheckinDisc.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BcheckinDisc.setBorderPainted(false);
        BcheckinDisc.setContentAreaFilled(false);
        BcheckinDisc.setText("Check In Disc");
        BcheckinDisc.addActionListener(new
        		OneBillingNewTransactionDlg_BcheckinDisc_actionAdapter(this));
        BcheckinDisc.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/checkin.png")));
        BreportLostDisc.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BreportLostDisc.setBorderPainted(false);
        BreportLostDisc.setContentAreaFilled(false);
        BreportLostDisc.setText("Report Lost Disc");
        BreportLostDisc.addActionListener(new
        		OneBillingNewTransactionDlg_BreportLostDisc_actionAdapter(this));
        BreportLostDisc.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/lostDisc.png")));
        BpayFees.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BpayFees.setBorderPainted(false);
        BpayFees.setContentAreaFilled(false);
        BpayFees.setText("Pay Fees");
        BpayFees.addActionListener(new
        		OneBillingNewTransactionDlg_BpayFees_actionAdapter(this));
        BpayFees.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/payFee.png")));
        BexpenseReport.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BexpenseReport.setBorderPainted(false);
        BexpenseReport.setContentAreaFilled(false);
        BexpenseReport.setText("Total Expense Report");
        BexpenseReport.addActionListener(new
        		OneBillingNewTransactionDlg_BexpenseReport_actionAdapter(this));
        BexpenseReport.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/expenseReport.png")));
        BrevReport.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BrevReport.setBorderPainted(false);
        BrevReport.setContentAreaFilled(false);
        BrevReport.setText("Gross Revenue Report");
        BrevReport.addActionListener(new
        		OneBillingNewTransactionDlg_BrevReport_actionAdapter(this));
        BrevReport.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/revenueReport.png")));
        BdueItemsReport.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BdueItemsReport.setBorderPainted(false);
        BdueItemsReport.setContentAreaFilled(false);
        BdueItemsReport.setText("Overdue Items Report");
        BdueItemsReport.addActionListener(new
        		OneBillingNewTransactionDlg_BdueItemsReport_actionAdapter(this));
        BdueItemsReport.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/dueDiscReport.png")));
        BcheckCollect.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BcheckCollect.setBorderPainted(false);
        BcheckCollect.setContentAreaFilled(false);
        BcheckCollect.setText("Check Points/Collect Gift");
        BcheckCollect.addActionListener(new
        		OneBillingNewTransactionDlg_BcheckCollect_actionAdapter(this));
        BcheckCollect.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/collectGift.png")));
        BmemberPolicy.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BmemberPolicy.setBorderPainted(false);
        BmemberPolicy.setContentAreaFilled(false);
        BmemberPolicy.setText("Membership Policy");
        BmemberPolicy.addActionListener(new
        		OneBillingNewTransactionDlg_BmemberPolicy_actionAdapter(this));
        BmemberPolicy.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/memberPolicy.png")));
        BrentalPolicy.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BrentalPolicy.setBorderPainted(false);
        BrentalPolicy.setContentAreaFilled(false);
        BrentalPolicy.setText("Rental Policy");
        BrentalPolicy.addActionListener(new
        		OneBillingNewTransactionDlg_BrentalPolicy_actionAdapter(this));
        BrentalPolicy.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/rentalPolicy.png")));
        BbanMember.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BbanMember.setBorderPainted(false);
        BbanMember.setContentAreaFilled(false);
        BbanMember.setText("Ban Member");
        BbanMember.addActionListener(new
        		OneBillingNewTransactionDlg_BbanMember_actionAdapter(this));
        BbanMember.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/banMember.png")));
        BdiscTypeAdmin.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BdiscTypeAdmin.setBorderPainted(false);
        BdiscTypeAdmin.setContentAreaFilled(false);
        BdiscTypeAdmin.setText("Disc Type Administration");
        BdiscTypeAdmin.addActionListener(new
        		OneBillingNewTransactionDlg_BdiscTypeAdmin_actionAdapter(this));
        BdiscTypeAdmin.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/discType.png")));
        
//new implementation 

        BaddUsers.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BaddUsers.setBorderPainted(false);
        BaddUsers.setContentAreaFilled(false);
        BaddUsers.setText("Add New User");
        BaddUsers.addActionListener(new
        		OneBillingNewTransactionDlg_BaddUsers_actionAdapter(this));
        BaddUsers.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/addMember.png")));
       

        BeditRemoveUsers.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BeditRemoveUsers.setBorderPainted(false);
        BeditRemoveUsers.setContentAreaFilled(false);
        BeditRemoveUsers.setText("Edit and Remove User");
        BeditRemoveUsers.addActionListener(new
        		OneBillingNewTransactionDlg_BeditRemoveUsers_actionAdapter(this));
        BeditRemoveUsers.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/editMember.png")));

        BviewUsers.setFont(new java.awt.Font("Dialog", Font.BOLD, 12));
        BviewUsers.setBorderPainted(false);
        BviewUsers.setContentAreaFilled(false);
        BviewUsers.setText("View All Users");
        BviewUsers.addActionListener(new
        		OneBillingNewTransactionDlg_BviewUsers_actionAdapter(this));
        BviewUsers.setIcon(new ImageIcon(OneBillingNewTransactionDlg.class.getResource("images/unbanMember.png")));
        
        
        getContentPane().add(JPnewTransaction);
        JPnewTransaction.add(JTPnewTransaction);
        
        
        // Access control base on login User roles
        if( loginUser.getRole() == EnumUserRole.SUPERADMIN ||
        	loginUser.getRole() == EnumUserRole.ADMIN||
        	loginUser.getRole() == EnumUserRole.AGENT){
            JTPnewTransaction.add(JPinventoryControl, "Customer Complain", 0);
            JPinventoryControl.add(BaddDisc);
            JPinventoryControl.add(BremoveDisc);
            JPinventoryControl.add(BeditDisc);
            JPinventoryControl.add(BdiscTypeAdmin);
            
        	JTPnewTransaction.add(JPrewardMgt, "Customer Bill", 1);
            JPrewardMgt.add(BcheckCollect);
            JPnewTransaction.add(Bclose);
            JPnewTransaction.add(imageLabel);
        }

        if (loginUser.getRole() == EnumUserRole.SUPERADMIN ||
        		loginUser.getRole() == EnumUserRole.ADMIN) {
        JTPnewTransaction.add(JPmemAdmin, "Customer Control", 2);
        JPmemAdmin.add(BaddMember);
        JPmemAdmin.add(BcancelMember);
        JPmemAdmin.add(BeditMember);
        JPmemAdmin.add(BbanMember);
        JPmemAdmin.add(BunbanMember);
        JPmemAdmin.add(BmemberPolicy);
        
        JTPnewTransaction.add(JPbasicReport, "Customer Subscription", 3);
        JPbasicReport.add(BexpenseReport);
        JPbasicReport.add(BrevReport);
        JPbasicReport.add(BdueItemsReport);
        }
        

        
        if (loginUser.getRole() == EnumUserRole.SUPERADMIN) {
        	JTPnewTransaction.add(JPuserAdmin, "Super Admin Control", 4);
        	JPuserAdmin.add(BaddUsers);
        	JPuserAdmin.add(BeditRemoveUsers);
        	JPuserAdmin.add(BviewUsers);
        }
        
        this.setSize(673, 450);
        this.center();
    }

    private void center(){
        //center the dialog
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = this.getSize();
        if (frameSize.height > screenSize.height)
            frameSize.height = screenSize.height;
        if (frameSize.width > screenSize.width)
            frameSize.width = screenSize.width;
        this.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    }
    

    public void Bclose_actionPerformed(ActionEvent e) {
        this.dispose();
    }

    
    public void BcheckoutDisc_actionPerformed(ActionEvent e) {
        /* Create and display Member login dialog */
       // MemberLoginDlg memLoginDlg=new MemberLoginDlg((Frame)this.getOwner(), VersionControl.getProductName()+" - Member Login", true);
        this.dispose();
       // memLoginDlg.setVisible(true);
    }

    public void BcheckinDisc_actionPerformed(ActionEvent e) {
        /* Create CheckInUI Panel and add it to GenericDialog */
       // CheckInUI checkInUI = new CheckInUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Check In Disc", true,
       //                             new Dimension(800, 570), checkInUI);
       // checkInUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BreportLostDisc_actionPerformed(ActionEvent e) {
        /* Create ReportLostDiscUI Panel and add it to GenericDialog */
       // ReportLostDiscUI reportLostDiscUI = new ReportLostDiscUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Report Lost Disc", true,
       //                             new Dimension(800, 570), reportLostDiscUI);
        //reportLostDiscUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BpayFees_actionPerformed(ActionEvent e) {
        /* Create PayFeesUI Panel and add it to GenericDialog */
        //PayFeesUI payFeesUI = new PayFeesUI();
        //GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Pay Fees", true,
       //                             new Dimension(800, 570), payFeesUI);
       // payFeesUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BaddDisc_actionPerformed(ActionEvent e) {
        /* Create AddDiscUI Panel and add it to GenericDialog */
        //AddDiscUI addDiscUI = new AddDiscUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Add Disc Record", true,
       //                             new Dimension(800, 570), addDiscUI);
       // addDiscUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BremoveDisc_actionPerformed(ActionEvent e) {
        /* Create RemoveDiscUI Panel and add it to GenericDialog */
       // RemoveDiscUI removeDiscUI = new RemoveDiscUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Remove Disc Record", true,
       //                             new Dimension(800, 570), removeDiscUI);
        //removeDiscUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BeditDisc_actionPerformed(ActionEvent e) {
        /* Create EditDiscUI Panel and add it to GenericDialog */
       // EditDiscUI editDiscUI = new EditDiscUI();
        //GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Edit Disc Record", true,
        //                            new Dimension(800, 570), editDiscUI);
        //editDiscUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }
    public void BaddMember_actionPerformed(ActionEvent e) {
        /* Create AddMemberUI Panel and add it to GenericDialog */
       // AddMemberUI addMemberUI = new AddMemberUI();
        //GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Add Member Record", true,
         //                           new Dimension(800, 570), addMemberUI);
       // addMemberUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
      //  iDialog.setVisible(true);
    }

    public void BcancelMember_actionPerformed(ActionEvent e) {
        /* Create CancelMemberUI Panel and add it to GenericDialog */
        //CancelMemberUI cancelMemberUI = new CancelMemberUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Cancel Membership", true,
       //                             new Dimension(800, 570), cancelMemberUI);
       // cancelMemberUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BeditMember_actionPerformed(ActionEvent e) {
        /* Create EditMemberUI Panel and add it to GenericDialog */
       // UpgradeEditMemberUI editMemberUI = new UpgradeEditMemberUI();
        //GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Edit Member Record", true,
        //                            new Dimension(800, 570), editMemberUI);
       // editMemberUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
        //iDialog.setVisible(true);
    }

    public void BbanMember_actionPerformed(ActionEvent e) {
        /* Create BanMemberUI Panel and add it to GenericDialog */
       // BanMemberUI banMemberUI = new BanMemberUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Ban Member", true,
        //                            new Dimension(800, 570), banMemberUI);
       // banMemberUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BunbanMember_actionPerformed(ActionEvent e) {
        /* Create UnbanMemberUI Panel and add it to GenericDialog */
        //UnbanMemberUI unbanMemberUI = new UnbanMemberUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Unban Member", true,
       //                             new Dimension(800, 570), unbanMemberUI);
       // unbanMemberUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
        //iDialog.setVisible(true);
    }

    public void BexpenseReport_actionPerformed(ActionEvent e) {
        /* Create ExpenseReportUI Panel and add it to GenericDialog */
        //ExpenseReportUI expenseReportUI = new ExpenseReportUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Total Expense Report", true,
       //                             new Dimension(800, 570), expenseReportUI);
        //expenseReportUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
        //iDialog.setVisible(true);
    }

    public void BrevReport_actionPerformed(ActionEvent e) {
        /* Create RevenueReportUI Panel and add it to GenericDialog */
       // RevenueReportUI revenueReportUI = new RevenueReportUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Gross Revenue Report", true,
         //                           new Dimension(800, 570), revenueReportUI);
        //revenueReportUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BdueItemsReport_actionPerformed(ActionEvent e) {
        /* Create DueItemReportUI Panel and add it to GenericDialog */
       // DueItemReportUI dueItemReportUI = new DueItemReportUI();
       // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Overdue Items Report", true,
      //                              new Dimension(800, 570), dueItemReportUI);
       // dueItemReportUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       // iDialog.setVisible(true);
    }

    public void BcheckCollect_actionPerformed(ActionEvent e) {
        /* Create CheckCollectUI Panel and add it to GenericDialog */
        // CheckCollectUI checkCollectUI = new CheckCollectUI();
        // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Check Points/Collect Gift", true,
        //                            new Dimension(800, 570), checkCollectUI);
        // checkCollectUI.setOwner(iDialog);
         this.dispose();
         /* Shows the GenericDialog*/
        // iDialog.setVisible(true);
    }

    public void BmemberPolicy_actionPerformed(ActionEvent e) {
        /* Create SetMemberPolicyUI Panel and add it to GenericDialog */
         //SetMemberPolicyUI setMemberPolicyUI = new SetMemberPolicyUI();
         //GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Set Membership Policy", true,
         //                           new Dimension(800, 570), setMemberPolicyUI);
        // setMemberPolicyUI.setOwner(iDialog);
         this.dispose();
         /* Shows the GenericDialog*/
        // iDialog.setVisible(true);
    }

    public void BrentalPolicy_actionPerformed(ActionEvent e) {
        /* Create SetRentalPolicyUI Panel and add it to GenericDialog */
        // SetRentalPolicyUI setRentalPolicyUI = new SetRentalPolicyUI();
        // GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Set Rental Policy", true,
         //                           new Dimension(800, 570), setRentalPolicyUI);
        // setRentalPolicyUI.setOwner(iDialog);
         this.dispose();
         /* Shows the GenericDialog*/
         //iDialog.setVisible(true);
    }

    public void BdiscTypeAdmin_actionPerformed(ActionEvent e) {
        //DiscTypeDlg discTypeDlg=new DiscTypeDlg((Frame)this.getOwner(), VersionControl.getProductName()+" - Disc Type Administration", true);
        this.dispose();
        //discTypeDlg.setVisible(true);
    }
    
    
 //new implementation   
    public void BaddUsers_actionPerformed(ActionEvent e) {
        /* add Users */
    	AddUserUI addUserUI = new AddUserUI();
        GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Add User", true,
                                    new Dimension(800, 570), addUserUI);
       addUserUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
       iDialog.setVisible(true);
    }
    
    public void BeditRemoveUsers_actionPerformed(ActionEvent e) {
        /* Edit and Remove User */
    	EditRemoveUserUI editRemoveUserUI = new EditRemoveUserUI();
        GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - Edit and Remove User", true,
                                    new Dimension(800, 570), editRemoveUserUI);
        editRemoveUserUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
        iDialog.setVisible(true);
    }
    
    public void BviewUsers_actionPerformed(ActionEvent e) {
        /* View Users */
    	EditRemoveUserUI editRemoveUserUI = new EditRemoveUserUI();
        GenericDialog iDialog=new GenericDialog((Frame)this.getOwner(), VersionControl.getProductName()+" - View Users", true,
                                    new Dimension(800, 570), editRemoveUserUI);
        editRemoveUserUI.setOwner(iDialog);
        this.dispose();
        /* Shows the GenericDialog*/
        iDialog.setVisible(true);
    }

}


class OneBillingNewTransactionDlg_BdiscTypeAdmin_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BdiscTypeAdmin_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BdiscTypeAdmin_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BmemberPolicy_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BmemberPolicy_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BmemberPolicy_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BrentalPolicy_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BrentalPolicy_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BrentalPolicy_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BcheckCollect_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BcheckCollect_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BcheckCollect_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BexpenseReport_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BexpenseReport_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BexpenseReport_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BrevReport_actionAdapter implements ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BrevReport_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BrevReport_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BdueItemsReport_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BdueItemsReport_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BdueItemsReport_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BunbanMember_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BunbanMember_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BunbanMember_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BeditMember_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BeditMember_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BeditMember_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BbanMember_actionAdapter implements ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BbanMember_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BbanMember_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BaddMember_actionAdapter implements ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BaddMember_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BaddMember_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BcancelMember_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BcancelMember_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BcancelMember_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BeditDisc_actionAdapter implements ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BeditDisc_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BeditDisc_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BaddDisc_actionAdapter implements ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BaddDisc_actionAdapter(OneBillingNewTransactionDlg
                                                  adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BaddDisc_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BremoveDisc_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BremoveDisc_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BremoveDisc_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BreportLostDisc_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BreportLostDisc_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BreportLostDisc_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BpayFees_actionAdapter implements ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BpayFees_actionAdapter(OneBillingNewTransactionDlg
                                                  adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BpayFees_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BcheckoutDisc_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BcheckoutDisc_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BcheckoutDisc_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BcheckinDisc_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BcheckinDisc_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BcheckinDisc_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_Bclose_actionAdapter implements ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_Bclose_actionAdapter(OneBillingNewTransactionDlg adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.Bclose_actionPerformed(e);
    }
}


//new implementation  

class OneBillingNewTransactionDlg_BaddUsers_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BaddUsers_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BaddUsers_actionPerformed(e);
    }
}


class OneBillingNewTransactionDlg_BeditRemoveUsers_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BeditRemoveUsers_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BeditRemoveUsers_actionPerformed(e);
    }
}

class OneBillingNewTransactionDlg_BviewUsers_actionAdapter implements
        ActionListener {
    private OneBillingNewTransactionDlg adaptee;
    OneBillingNewTransactionDlg_BviewUsers_actionAdapter(OneBillingNewTransactionDlg
            adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.BviewUsers_actionPerformed(e);
    }
}

